package cn.tedu._10springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator{

    @Override
    public int add(int a, int b) {
//        if (a>0){
//            throw new IllegalArgumentException("a不能大于0");
//        }
        int result =a+b;
        System.out.println("方法内部："+result);
        return result;
    }

    @Override
    public int sut(int a, int b) {
        int result =a-b;
        System.out.println("方法内部："+result);
        return result;
    }

    @Override
    public int mul(int a, int b) {
        int result =a*b;
        System.out.println("方法内部："+result);
        return result;
    }

    @Override
    public int div(int a, int b) {
        int result =a/b;
        System.out.println("方法内部："+result);
        return result;
    }
}
